﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Shop.Model;

namespace Shop.Framework.Control {
    public class ThumbnailViewer:ViewUserControl<Product> {

        public ProductImage MainImage { get; set; }
        public List<ProductImage> ImageList { get; set; }

        protected override void OnInit(EventArgs e) {
            MainImage = Model.ProductImages.FirstOrDefault(img => img.IsDefault);
            ImageList = Model.ProductImages.ToList();
            base.OnInit(e);
        }

    }
}
